<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateWlGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wl_goods', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->integer("location_id")->comment("岗点id");
            $table->string("goods_name")->comment("产品名");
            $table->string("goods_image")->comment("产品主图")->nullable();
            $table->integer("goods_category_id")->comment("产品类别id")->nullable();
            $table->string("spec")->comment("规格")->nullable();
            $table->string("tags")->comment("标签")->nullable();
            $table->text("content")->nullable()->comment("内容");
            $table->integer("author_id")->nullable()->comment("作家id");
            $table->string("barcode")->nullable()->comment("二维码路径");
        });
        DB::statement("ALTER TABLE `wl_goods` comment'外联扫码专用表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wl_goods');
    }
}
